package m.toolkit.rrd4j;
import java.util.ArrayList;
import java.util.List;

import m.toolkit.rrd4j.GraphItem.ItemType;
import m.toolkit.rrd4j.Rra.ConsolidationFunction;

/**
 * @author ming
 * @date 2014年2月24日下午9:59:57
 */
public class Graph {
	private String fileName;
	private Long start;
	private Long end;
	//-t
	private String title;
	//-v 纵轴标签
	private String vertical;
	//Y轴最小值
	private Long lower_limit;
	//--upper-limit
	private Long upper_limit;
	//强制不让Y轴自动调整
	private boolean rigid;
	private List<Def> def;
	private List<GraphItem> graphItem;
	
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public Long getStart() {
		return start;
	}
	public void setStart(Long start) {
		this.start = start;
	}
	public Long getEnd() {
		return end;
	}
	public void setEnd(Long end) {
		this.end = end;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getVertical() {
		return vertical;
	}
	public void setVertical(String vertical) {
		this.vertical = vertical;
	}
	public Long getLower_limit() {
		return lower_limit;
	}
	public void setLower_limit(Long lower_limit) {
		this.lower_limit = lower_limit;
	}
	public Long getUpper_limit() {
		return upper_limit;
	}
	public void setUpper_limit(Long upper_limit) {
		this.upper_limit = upper_limit;
	}
	public boolean isRigid() {
		return rigid;
	}
	public void setRigid(boolean rigid) {
		this.rigid = rigid;
	}
	public List<Def> getDef() {
		return def;
	}
	public void setDef(List<Def> def) {
		this.def = def;
	}
	public List<GraphItem> getGraphItem() {
		return graphItem;
	}
	public void setGraphItem(List<GraphItem> graphItem) {
		this.graphItem = graphItem;
	}
	public void addDef(String vname,String fileName,String dsName,ConsolidationFunction cf) {
		Def df=new Def();
		df.setFileName(fileName);
		df.setVname(vname);
		df.setCf(cf);
		df.setDsName(dsName);
		if(def==null){
			def=new ArrayList();
		}
		def.add(df);
	}
	
	public void addOutput(ItemType itemType,String args) {
		if(graphItem==null){
			graphItem=new ArrayList();
		}
		
		GraphItem item=new GraphItem();
		item.setArgs(args);
		item.setItemType(itemType);
		graphItem.add(item);
	}
	
	
}




